package top.kpromise.note.modules.user.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import top.kpromise.common.base.Result;
import top.kpromise.note.base.BaseApi;
import top.kpromise.note.modules.user.entity.UserInfo;

@RestController
@Api(tags = {"用户信息"})
@RequestMapping("/api/user")
public class User extends BaseApi {

    @RequestMapping(value = "/info", method = RequestMethod.GET)
    @ApiOperation(value = "获取用户信息")
    public Result<UserInfo> getUserInfo() {
        UserInfo userInfo = new UserInfo();
        userInfo.init(userInfo().getNickName());
        return Result.data(userInfo);
    }
}
